<template>
  <el-container class="home-container">
    <!-- 头部区域 -->
    <el-header class="header-container">
      <el-row type="flex" justify="space-between" class="nav-container">
        <el-col class="title" :span="16">
            <!-- 图标 -->
            <img   src="../assets/img/quartzlogo.png" alt="">
            <!-- 题目 -->
            <span>Quartz.Net后台任务调度</span>
        </el-col>
        <el-col :span="8">
          <el-menu
            :default-active="activeIndex"
            class="el-menu-demo"
            mode="horizontal"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#fff"
            router
          >
            <el-menu-item index="/job">任务中心</el-menu-item>
            <el-menu-item index="/help">指南</el-menu-item>
            <el-menu-item index="3" @click="logout">退出</el-menu-item>
          </el-menu>
        </el-col>
      </el-row>
    </el-header>
    <!-- 页面主题区域 -->
    <el-main>
      <!-- 路由占位符 -->
      <router-view></router-view>
    </el-main>
  </el-container>
</template>

<script>
export default {
  name: "Home",
  components: {},
  data() {
    return {
      activeIndex: "1",
    };
  },

  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    logout() {
      // 清空token
      window.sessionStorage.clear();
      // 跳转到登录页面
      this.$router.push("/login");
    },
  },
  created() {},
  mounted() {},
  beforeCreate() {},
  beforeMount() {},
  beforeUpdate() {},
  updated() {},
  beforeDestroy() {},
  destroyed() {},
  activated() {},
};
</script>
<style lang='less' scoped>
.header-container {
  height: 100px;
  padding: 0px;
  background-color: rgb(112, 105, 105);
}
.logobox{

    vertical-align: center;
}

.title{
    color: #fff;
    font-size: 23px;
    height: 60px;
    line-height: 60px;
    padding-left: 80px;
    display: flex;
    align-items: center;
    img{
        margin-right: 15px;
    }
}
.home-container {
  height: 100%;
  background-color: antiquewhite;
}
.nav-container {
    width: 100%;
    background-color: #545c64;
}
.el-menu-demo {
    display: flex;
    justify-content:flex-end;
    height: 100%;
    padding-right: 60px;
    
}
</style>